import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [

  {
    path: '/',
    hidden: true,//不在导航列表中显示
    redirect: '/login',  //当路由未匹配时重定向，可作初始划显示页面设置
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login/index')
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/Home/index'),
    redirect: '/user_info',
    children: [
      {
        path: "/user_info",
        name: "UserInfo",
        component: () => import('../views/UserInfo/index')
      },
      {
        path: "/page1",
        name: "Page1",
        component: () => import('../views/Page1/index')
      },
      {
        path: "/page2",
        name: "Page2",
        component: () => import('../views/Page2/index')
      }
      , {
        path: "/page3",
        name: "Page3",
        component: () => import('../views/Page3/index')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'hash', // 去掉#，需要路由模式改为history
  routes
})

export default router
